package domin;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Mc.Chai
 * @program: JavaWeb
 * @create 2022-03-29-16:27 16:27
 */
public class User {
    private String name;
    private int age;
    private Date birthday;

    public User(String name, int age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }



    public User(){

    }
    public String stringBirthday(){
        if (birthday!=null){
            //格式化日期字符串
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-DD hh:mm:ss");
            return simpleDateFormat.format(birthday);
        }
        return "";


    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {

        this.birthday = birthday;
    }


}
